package hcmus.fit.master.sevensea.core;

import java.util.Timer;
import java.util.TimerTask;

import android.content.Context;
import android.view.View;

public abstract class AbstractView extends View {

    protected Timer timer;

    public Timer getTimer() {
        return timer;
    }

    public void setTimer(Timer timer) {
        this.timer = timer;
    }

    public AbstractView(Context context) {
        super(context);
        timer = new Timer();
        timer.scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
                update();
                postInvalidate();
            }
        }, 3000, Constant.MAIN_TIMER_DELAY);
    }

    public abstract void update();
}
